package com.whfc.safety.dao;

import com.whfc.safety.dto.SafetyDangerAcceptDTO;
import com.whfc.safety.entity.SafetyDangerAttach;
import com.whfc.safety.param.SafetyDangerAttachParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SafetyDangerAttachMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SafetyDangerAttach record);

    int insertSelective(SafetyDangerAttach record);

    SafetyDangerAttach selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SafetyDangerAttach record);

    int updateByPrimaryKey(SafetyDangerAttach record);

    /**
     * 批量添加
     *
     * @param deptId
     * @param dangerId
     * @param objId
     * @param attachUrls
     * @param userId
     * @param userName
     */
    void insertAll(@Param("deptId") Integer deptId,
                   @Param("dangerId") Integer dangerId,
                   @Param("objId") Integer objId,
                   @Param("attachUrls") List<SafetyDangerAttachParam> attachUrls,
                   @Param("userId") Integer userId,
                   @Param("userName") String userName);

    /**
     * 危大工程附件
     *
     * @param objIds
     * @param types
     * @return
     */
    List<SafetyDangerAcceptDTO> selectByObjIdsAndType(@Param("dangerId") Integer dangerId, @Param("objIds") List<Integer> objIds, @Param("types") List<Integer> types);

    /**
     * 软删除
     *
     * @param dangerId
     * @param objId
     * @param type
     */
    void delByDangerIdAndObjIdAndType(@Param("dangerId") Integer dangerId, @Param("objId") Integer objId, @Param("type") Integer type);

    /**
     * 软删除
     *
     * @param dangerId
     */
    void delByDangerId(@Param("dangerId") Integer dangerId,@Param("types") List<Integer> type);

    /**
     * 软删除
     *
     * @param attachId
     */
    void delById(Integer attachId);
}